//
//  CYABPersonModernHook.m
//  CreditAddressBook
//
//  Created by Lee on 15/7/18.
//  Copyright (c) 2015年 Lee. All rights reserved.
//

#import "CYABPersonModernHook.h"
#import <objc/runtime.h>
#import "CYJumpsTool.h"

@implementation CYABPersonModernHook

+ (void)hook {
    Class aClass = objc_getClass("ABPersonViewController_Modern");
    SEL sel = @selector(hook_viewDidLoad);
    // 为UIWebBrowserView增加函数
    class_addMethod(aClass, sel, class_getMethodImplementation([self class], sel), "v@:@@");
    // 交换实现
    [CYJumpsTool exchangeMethodWhthClass:aClass oldSEL:@selector(viewDidLoad) newClass:aClass newSEL:sel];
}

- (void)hook_viewDidLoad {
    [self setEditing:YES animated:NO];
//    [self hook_viewDidLoad];
//        self.editing = YES;
    CYLog(@"运行ABPersonViewController");
}
@end
